#ifndef AT32F415RCT7_USART_H
#define AT32F415RCT7_USART_H
#include "at32f415_conf.h"

typedef struct USART_CONF{
    crm_periph_clock_type usart_crm_clk_type;
    crm_periph_clock_type gpio_crm_clk_type;
    nvic_priority_group_type priority_group;
    IRQn_Type irqn;
    uint32_t preempt_priority;
    uint32_t sub_priority;
    usart_type* usart_x;
    uint32_t baud_rate;
    usart_data_bit_num_type data_bit;
    usart_stop_bit_num_type stop_bit;
    gpio_type *gpio_x;
    uint32_t gpio_pins_tx;
    uint32_t gpio_pins_rx;
}USART_CONF;

void at32f415_usart_configure(USART_CONF *usart_conf);

void rs485_receive_diable(USART_CONF *usart_conf);

void rs485_receive_enable(USART_CONF *usart_conf);
#endif
